package springEureka;

import java.util.Scanner;

import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;

@SpringBootApplication 
@EnableEurekaServer
public class RunStart {
	
	@SuppressWarnings("resource")
	public static void main(String[] args) {
		String profiles = null;
		for(int i=0;i<args.length;i++) {
			if("-profiles".equals(args[i])) {
				if(args.length>=(i+1))profiles = args[++i]; 
			}
		}
		if(profiles==null) {
			Scanner scan = new Scanner(System.in);
			profiles = scan.nextLine();
		}
		System.out.println("run profiles:"+profiles);
		new SpringApplicationBuilder(RunStart.class).profiles(profiles).run(args);
	}
}
